package com.yxp.webtest.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

/**
 * @author      : yang.xp
 * @date        : 2021/10/11 16:17
 * @description : 页面上的从 map 到 json的转换方式
 * https://docs.spring.io/spring-framework/docs/5.3.11-SNAPSHOT/reference/html/web.html#mvc-config-view-resolvers
 */
@Configuration
@EnableWebMvc
public class WebJsonConfig implements WebMvcConfigurer {

    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
//        registry.enableContentNegotiation(new MappingJackson2JsonView());
//        registry.jsp();
    }
}
